package org.jeecg.modules.xl.order.entity;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;

/**
 * @Description: xl_customer_order
 * @Author: jeecg-boot
 * @Date:   2024-10-20
 * @Version: V1.0
 */
@ApiModel(value="xl_customer_orde对象", description="xl_customer_order")
@Data
@TableName("xl_customer_orde")
public class XlCustomerOrde implements Serializable {
    private static final long serialVersionUID = 1L;

	/**主键*/
	@TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;
	/**订单单号*/
	@Excel(name = "订单单号", width = 15)
    @ApiModelProperty(value = "订单单号")
    private String orderCode;

    /**快麦单号*/
    @Excel(name = "快麦单号", width = 15)
    //@ApiModelProperty(value = "快麦单号")
    private String kmSid;
    /**创建日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "订单日期")
    @Excel(name = "订单时间", width = 25 ,format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    private String isDebt;
    //订单状态
    @Excel(name = "订单状态", width = 15)
    private String orderStatus;
    /**商品总数量*/
    @Excel(name = "商品总数量", width = 15)
    @ApiModelProperty(value = "商品总数量")
    private Double totalNum;
    /**商品种数*/
    @Excel(name = "商品种数", width = 15)
    @ApiModelProperty(value = "商品种数")
    private Integer detailNum;
    /**订单总金额*/
    @Excel(name = "订单总金额", width = 15)
    @ApiModelProperty(value = "订单总金额")
    private Double totalAmount;
    /**订单售后金额*/
    @TableField(exist = false)
    @Excel(name = "订单售后金额", width = 15)
    private Double totalAfterAmount;
    /**订单实付金额*/
    @TableField(exist = false)
    @Excel(name = "应收金额", width = 15)
    private Double totalRealAmount;
    private String statementUrl;
    @Excel(name = "实收金额", width = 15)
    private Double paymentAmount;


	/**门店编号*/
	@Excel(name = "门店编号", width = 15)
    @ApiModelProperty(value = "门店编号")
    private String storeCode;

    /**门店编号*/
    @Excel(name = "门店名称", width = 15)
    @ApiModelProperty(value = "门店名称")
    private String storeName;
    @Excel(name = "门店类型", width = 15)
    private String storeType;
    /**门店渠道类型*/
    private String customerTypeCode;
    /**门店渠道类型*/
    @Excel(name = "渠道类型", width = 15)
    private String customerType;
    /**发货方式(1:城配，2:快递)*/
    //@Excel(name = "发货方式(1:城配，2:快递)", width = 15, dicCode = "delivery_way")
    @Dict(dicCode = "delivery_way")
    /**
     * 发货方式
     */
    @Excel(name = "发货方式", width = 15,dicCode = "delivery_way")
    @ApiModelProperty(value = "发货方式(1:城配，2:快递)")
    private String deliveryWay;

    /**收件人*/
	@Excel(name = "收件人", width = 15)
    @ApiModelProperty(value = "收件人")
    private String receiptName;
	/**收件人手机号*/
	@Excel(name = "收件人手机号", width = 15)
    @ApiModelProperty(value = "收件人手机号")
    private String receiptPhone;
	/**收件地址省市区*/
   // @Excel(name = "收件地址省市区", width = 15 )
    @ApiModelProperty(value = "收件地址省市区")
    private String receiptZone;

    //@Excel(name = "省", width = 25,exportConvert=true,importConvert = true )
    @ApiModelProperty(value = "省")
    private String province;
    // @Excel(name = "市", width = 25,exportConvert=true,importConvert = true )
    @ApiModelProperty(value = "市")
    private String city;
    //@Excel(name = "区县", width = 25,exportConvert=true,importConvert = true )
    @ApiModelProperty(value = "区县")
    private String district;


    public String convertisReceiptZone() {
        return SpringContextUtils.getBean(ProvinceCityArea.class).getText(receiptZone);
    }

    public void convertsetReceiptZone(String text) {
        this.receiptZone = SpringContextUtils.getBean(ProvinceCityArea.class).getCode(text);
    }
	/**收件详细地址*/
	@Excel(name = "收件详细地址", width = 15)
    @ApiModelProperty(value = "收件详细地址")
    private String receiptAddress;

    /**审批状态(0:待审核，1:审核通过，2:审核不通过)*/
    //@Excel(name = "审批状态(0:待审核，1:审核通过，2:审核不通过)", width = 15)
    @ApiModelProperty(value = "审批状态(0:待审核，1:审核通过，2:审核不通过)")
    @Dict(dicCode = "audit_state")
    private String auditState;
    /**审批人*/
    @ApiModelProperty(value = "审批人")
    private String auditBy;
    /**审批意见*/
    @ApiModelProperty(value = "审批人")
    private String auditNote;
    /**审批时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "审批时间")
    private Date auditTime;

    /**支付状态(0：支付中，1:已支付)*/
    //@Excel(name = "支付状态(0：支付中，1:已支付)", width = 15)
    @ApiModelProperty(value = "支付状态(0：支付中，1:已支付)")
    @Dict(dicCode = "payment_state")
    private String paymentState;
    /**付款人*/
    @ApiModelProperty(value = "付款人")
    private String paymentBy;
    /**付款时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "付款时间")
    private Date paymentTime;
    /**付款凭证图片*/
    @ApiModelProperty(value = "付款凭证图片")
    private String paymentImage;


    //**发货状态(0:未发货，1:已发货)*//*
   // @Excel(name = "发货状态(0:未发货，1:已发货，2:部分发货)", width = 15)
    @Dict(dicCode = "shipment_state")
    private String shipmentState;
    //**发货人*//*
    @ApiModelProperty(value = "发货人")
    private String shipmentBy;
    //**发货时间*//*
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "发货时间")
    private Date shipmentTime;



    /**快递类型(1:三通一达，2:顺丰，3:京东，4:极兔，5:邮政，6:德邦)*/
    //@Excel(name = "快递类型(1:三通一达，2:顺丰，3:京东，4:极兔，5:邮政，6:德邦)", width = 15, dicCode = "delivery_type")
    @Dict(dicCode = "delivery_type")
    @ApiModelProperty(value = "快递类型(1:三通一达，2:顺丰，3:京东，4:极兔，5:邮政，6:德邦)")
    private String deliveryType;

    @ApiModelProperty(value = "是否城配已发货")
    private String isCity;

    @ApiModelProperty(value = "快递单集合")
    private String deliveryCodes;

    /**订单备注*/
    @Excel(name = "订单备注", width = 25)
    @ApiModelProperty(value = "订单备注")
    private String orderNotes;

	/**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;

	/**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
	/**更新日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;

    @TableField(exist = false)
    private Double logiCode;
}
